﻿Public Class ProgramDataGridRowDetailsWidthConverter
    Implements IValueConverter

    Public Function Convert(ByVal value As Object, ByVal targetType As System.Type, ByVal parameter As Object, ByVal culture As System.Globalization.CultureInfo) As Object Implements System.Windows.Data.IValueConverter.Convert
        Dim width = CDbl(value)
        If width - 60 > 0 Then
            Return width - 60
        Else
            Return 1
        End If
    End Function

    Public Function ConvertBack(ByVal value As Object, ByVal targetType As System.Type, ByVal parameter As Object, ByVal culture As System.Globalization.CultureInfo) As Object Implements System.Windows.Data.IValueConverter.ConvertBack
        Throw New NotSupportedException
        'If value Is Nothing Then
        '    Return DependencyProperty.UnsetValue
        'End If
        'Try
        '    Return CInt(value)
        'Catch ex As Exception
        '    Return DependencyProperty.UnsetValue
        'End Try
    End Function
End Class
